#ifndef WEB_SESSIONS_H
#define WEB_SESSIONS_H

#include <typedefs.h>


#ifndef DL_EV_BASE
#define DL_EV_BASE				0x82000
#endif

#define WS_EVENT				DL_EV_BASE | 0x0143



#define WS_NAME_LEN				16
#define WS_USER_NAME_LEN		32
#define WS_PW_LEN				16
#define WS_IP_LEN				8
#define WS_CSD_NUMBER_LEN		32
#define WS_URL_LEN				100

typedef struct
{
	UINT8	number[WS_CSD_NUMBER_LEN];
	WCHAR	user_name[WS_USER_NAME_LEN + 1];
	WCHAR	pw[WS_PW_LEN + 1];
	UINT8	speed;
	UINT8	type;
} WS_CSD_RECORD_T;


typedef struct
{
	WCHAR	apn[WS_URL_LEN + 1];
	WCHAR	user_name[WS_USER_NAME_LEN + 1];
	WCHAR	pw[WS_PW_LEN + 1];
} WS_GPRS_RECORD_T;


typedef struct
{
    UINT8	access;
    WCHAR	name[WS_NAME_LEN + 1];
    WCHAR	home_page[WS_URL_LEN + 1];
    UINT16	ip1[WS_IP_LEN];
    UINT16	port1;
    WCHAR	domain1[WS_URL_LEN + 1];
    UINT8	type1;	// WAP/HTTP/HTTPS
    UINT16	ip2[WS_IP_LEN];
    UINT16	port2;
    WCHAR	domain2[WS_URL_LEN + 1];
    UINT8	type2;
    UINT16	dns_ip1[WS_IP_LEN];
    UINT16	dns_ip2[WS_IP_LEN];
    UINT8	timeout;
    WS_CSD_RECORD_T * csd_rec1;
    WS_CSD_RECORD_T * csd_rec2;
    WS_GPRS_RECORD_T * gprs_rec;
} WS_RECORD_T; 

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */


UINT32
DL_DbWebSessionsGetDefaultSessionIndex( UINT8 * index );

UINT32
DL_DbWebSessionsSetDefaultSessionIndex( IFACE_DATA_T * iface_data, UINT8 index );

UINT32
DL_DbWebSessionsGetSessionByIndex( IFACE_DATA_T * iface_data, UINT8 index,
									WS_RECORD_T * ws_rec );


#ifdef __cplusplus
}
#endif /* __cplusplus */ 

#endif